import {Service, action} from "adajs";

class SlideService extends Service {
    defaultData() {
        return {
            isLoad: false,
            tabs: []
        };
    }

    @action("load")
    load(current) {
        return this.context.request.post("/api/cms/cmsArticleCache/queryPage", {
            page: 1,
            pageSize: 5,
            siteId: "cyjlgb",
            columnId: "COLUMN_PHONE_NEW"
        }).then(({data}) => {
            current.isLoad = true;
            data.rows.map(row => {
                row.image = "/api/resource/download/" + row.imgs;
            });
            current.tabs = data.rows;
        });
    }
}

export default SlideService;